package com.guodu.dao.impl;

import java.text.DecimalFormat;
import java.text.ParseException;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.guodu.base.BaseDao;
import com.guodu.dao.PurchaseBiddingPlanTwotzDao;
import com.guodu.entity.PurchaseBiddingPlanTwotz;
import com.guodu.entity.PurchasebiddingtwotzStatus;
import com.guodu.entity.Units;
import com.guodu.vo.PurchaseBiddingPlanTwotzQueryVo;
import com.guodu.vo.PurchaseBiddingPlanTwotzVo;


@Repository("purchaseBiddingPlanTwotzDao")
public class PurchaseBiddingPlanTwotzDaoImpl extends BaseDao implements PurchaseBiddingPlanTwotzDao {

	@Override
	public long findSizeByVo(PurchaseBiddingPlanTwotzQueryVo pbpq,Units units) {
		// TODO Auto-generated method stub
		StringBuffer hql = new StringBuffer("select count(*) from PurchaseBiddingPlanTwotz m where 1=1");
		if(pbpq!=null){
			if(pbpq.getFunitsId()!=null){
				hql.append("    and (exists(select 1 from Units u where u.unitsId = m.unitsId and u.funitsId="+pbpq.getFunitsId()+" ) or m.unitsId ="+pbpq.getFunitsId()+" )");
			}
			if(pbpq.getUnitsId()!=null && !"".equals(pbpq.getUnitsId())){
				hql.append(" and  m.unitsId = "+pbpq.getUnitsId()+"");
			}
			if(pbpq.getCreateBeginTime()!=null&&pbpq.getCreateBeginTime().trim().length()>0){
				hql.append(" and createTime >= TO_DATE('"+pbpq.getCreateBeginTime()+" 00:00:00','yyyy-mm-dd hh24:mi:ss')");
			}
			if(pbpq.getCreateEndTime()!=null&&pbpq.getCreateEndTime().trim().length()>0){
				hql.append(" and createTime <= TO_DATE('"+pbpq.getCreateEndTime()+" 23:59:59','yyyy-mm-dd hh24:mi:ss')");
			}
			if(pbpq.getStatus()!=null&&pbpq.getStatus().trim().length()>0&&!pbpq.getStatus().equals("5")){
				hql.append(" and status ="+pbpq.getStatus());
			}
			if (pbpq.getFcbeginTime()!=null && !"".equals(pbpq.getFcbeginTime())) {
				hql.append("    and issueTime >= TO_DATE('"+pbpq.getFcbeginTime()+" 00:00:00','yyyy-mm-dd hh24:mi:ss')");
			}
			if (pbpq.getFcendTime()!=null && !"".equals(pbpq.getFcendTime())) {
				hql.append("    and issueTime <= TO_DATE('"+pbpq.getFcendTime()+" 23:59:59','yyyy-mm-dd hh24:mi:ss')");
			}
			if (pbpq.getProcurementMethod()!=null && !"".equals(pbpq.getProcurementMethod())) {
				hql.append("    and procurementMethod like '%"+pbpq.getProcurementMethod()+"%'");
			}
			if(pbpq.getPurchaseYears()!=null&&pbpq.getPurchaseYears().trim().length()>0){
				hql.append(" and TO_DATE(purchaseYears,'yyyy') >= TO_DATE('"+pbpq.getPurchaseYears()+"','yyyy')");
			}
			if(pbpq.getEpurchaseYears()!=null&&pbpq.getEpurchaseYears().trim().length()>0){
				hql.append(" and TO_DATE(purchaseYears,'yyyy') <= TO_DATE('"+pbpq.getEpurchaseYears()+"','yyyy')");
			}
			if (pbpq.getProjectName()!=null && !"".equals(pbpq.getProjectName())) {
				hql.append("    and projectName like '%"+pbpq.getProjectName()+"%'");
			}
			if (pbpq.getProjectSituation()!=null && !"".equals(pbpq.getProjectSituation())) {
				hql.append("    and projectSituation like '%"+pbpq.getProjectSituation()+"%'");
			}
			if (pbpq.getProjecttype()!=null && !"".equals(pbpq.getProjecttype())) {
				hql.append("    and projectType like '%"+pbpq.getProjecttype()+"%'");
			}
			if (pbpq.getSecClassification()!=null && !"".equals(pbpq.getSecClassification())) {
				hql.append("    and secClassification like '%"+pbpq.getSecClassification()+"%'");
			}
			if (pbpq.getSecName()!=null && !"".equals(pbpq.getSecName())) {
				hql.append("    and secName like '%"+pbpq.getSecName()+"%'");
			}
			if (pbpq.getSectionName()!=null && !"".equals(pbpq.getSectionName())) {
				hql.append("    and sectionName like '%"+pbpq.getSectionName()+"%'");
			}
			if (pbpq.getAdjustment()!=null && !"".equals(pbpq.getAdjustment())) {
				hql.append("    and adjustment like '%"+pbpq.getAdjustment()+"%'");
			}
		}
		if(units==null){
			hql.append(" and ((status=0 and exists(select 1 from UserInfo u where u.userId = m.createPeople and exists (select 1 from Units n where n.unitsId=u.unitsId and n.unitsLevel = '1'))) or status=1 or status=3) ");
		}
		return super.findInt(hql.toString());
	}
	@Override
	public void examinAll(PurchaseBiddingPlanTwotzQueryVo pbpq, Units units) {
		// TODO Auto-generated method stub
		StringBuffer hql = new StringBuffer();
		if(units==null){
			hql.append("update from PurchaseBiddingPlanTwotz m set m.status=3 where m.status=0");
			
		}else if(units.getUnitsLevel()==1L){
			hql.append("update from PurchaseBiddingPlanTwotz m set m.status=1 where m.status=0");
		}
		if(pbpq!=null){
			if(pbpq.getFunitsId()!=null){
				hql.append("    and (exists(select 1 from Units u where u.unitsId = m.unitsId and u.funitsId="+pbpq.getFunitsId()+" ) or m.unitsId ="+pbpq.getFunitsId()+" )");
			}
			if(pbpq.getUnitsId()!=null && !"".equals(pbpq.getUnitsId())){
				hql.append(" and  m.unitsId = "+pbpq.getUnitsId()+"");
			}
			if(pbpq.getCreateBeginTime()!=null&&pbpq.getCreateBeginTime().trim().length()>0){
				hql.append(" and createTime >= TO_DATE('"+pbpq.getCreateBeginTime()+" 00:00:00','yyyy-mm-dd hh24:mi:ss')");
			}
			if(pbpq.getCreateEndTime()!=null&&pbpq.getCreateEndTime().trim().length()>0){
				hql.append(" and createTime <= TO_DATE('"+pbpq.getCreateEndTime()+" 23:59:59','yyyy-mm-dd hh24:mi:ss')");
			}
			if(pbpq.getStatus()!=null&&pbpq.getStatus().trim().length()>0&&!pbpq.getStatus().equals("5")){
				hql.append(" and status ="+pbpq.getStatus());
			}
			if (pbpq.getFcbeginTime()!=null && !"".equals(pbpq.getFcbeginTime())) {
				hql.append("    and issueTime >= TO_DATE('"+pbpq.getFcbeginTime()+" 00:00:00','yyyy-mm-dd hh24:mi:ss')");
			}
			if (pbpq.getFcendTime()!=null && !"".equals(pbpq.getFcendTime())) {
				hql.append("    and issueTime <= TO_DATE('"+pbpq.getFcendTime()+" 23:59:59','yyyy-mm-dd hh24:mi:ss')");
			}
			if (pbpq.getProcurementMethod()!=null && !"".equals(pbpq.getProcurementMethod())) {
				hql.append("    and procurementMethod like '%"+pbpq.getProcurementMethod()+"%'");
			}
			if(pbpq.getPurchaseYears()!=null&&pbpq.getPurchaseYears().trim().length()>0){
				hql.append(" and TO_DATE(purchaseYears,'yyyy') >= TO_DATE('"+pbpq.getPurchaseYears()+"','yyyy')");
			}
			if(pbpq.getEpurchaseYears()!=null&&pbpq.getEpurchaseYears().trim().length()>0){
				hql.append(" and TO_DATE(purchaseYears,'yyyy') <= TO_DATE('"+pbpq.getEpurchaseYears()+"','yyyy')");
			}
			if (pbpq.getProjectName()!=null && !"".equals(pbpq.getProjectName())) {
				hql.append("    and projectName like '%"+pbpq.getProjectName()+"%'");
			}
			if (pbpq.getProjectSituation()!=null && !"".equals(pbpq.getProjectSituation())) {
				hql.append("    and projectSituation like '%"+pbpq.getProjectSituation()+"%'");
			}
			if (pbpq.getProjecttype()!=null && !"".equals(pbpq.getProjecttype())) {
				hql.append("    and projectType like '%"+pbpq.getProjecttype()+"%'");
			}
			if (pbpq.getSecClassification()!=null && !"".equals(pbpq.getSecClassification())) {
				hql.append("    and secClassification like '%"+pbpq.getSecClassification()+"%'");
			}
			if (pbpq.getSecName()!=null && !"".equals(pbpq.getSecName())) {
				hql.append("    and secName like '%"+pbpq.getSecName()+"%'");
			}
			if (pbpq.getSectionName()!=null && !"".equals(pbpq.getSectionName())) {
				hql.append("    and sectionName like '%"+pbpq.getSectionName()+"%'");
			}
			if (pbpq.getAdjustment()!=null && !"".equals(pbpq.getAdjustment())) {
				hql.append("    and adjustment like '%"+pbpq.getAdjustment()+"%'");
			}
		}
		if(units==null){
			hql.append(" and ((status=0 and exists(select 1 from UserInfo u where u.userId = m.createPeople and exists (select 1 from Units n where n.unitsId=u.unitsId and n.unitsLevel = '1'))) or status=1 or status=3) ");
		}
		super.executeUpdate(hql.toString());
		
	}

	@Override
	public void save(PurchaseBiddingPlanTwotz purchaseBiddingPlanTwotz) {
		// TODO Auto-generated method stub
		super.save(purchaseBiddingPlanTwotz);
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<PurchaseBiddingPlanTwotz> findByVo(PurchaseBiddingPlanTwotzQueryVo pbpq, Units units, int curPage, int pageSize) {
		// TODO Auto-generated method stub
		StringBuffer hql = new StringBuffer("from PurchaseBiddingPlanTwotz m where 1=1");
		if(pbpq!=null){
			if(pbpq.getFunitsId()!=null){
				hql.append("    and (exists(select 1 from Units u where u.unitsId = m.unitsId and u.funitsId="+pbpq.getFunitsId()+" ) or m.unitsId ="+pbpq.getFunitsId()+" )");
			}
			if(pbpq.getUnitsId()!=null && !"".equals(pbpq.getUnitsId())){
				hql.append(" and  m.unitsId = "+pbpq.getUnitsId()+"");
			}
			if(pbpq.getCreateBeginTime()!=null&&pbpq.getCreateBeginTime().trim().length()>0){
				hql.append(" and createTime >= TO_DATE('"+pbpq.getCreateBeginTime()+" 00:00:00','yyyy-mm-dd hh24:mi:ss')");
			}
			if(pbpq.getCreateEndTime()!=null&&pbpq.getCreateEndTime().trim().length()>0){
				hql.append(" and createTime <= TO_DATE('"+pbpq.getCreateEndTime()+" 23:59:59','yyyy-mm-dd hh24:mi:ss')");
			}
			if(pbpq.getStatus()!=null&&pbpq.getStatus().trim().length()>0&&!pbpq.getStatus().equals("5")){
				hql.append(" and status ="+pbpq.getStatus());
			}
			if (pbpq.getFcbeginTime()!=null && !"".equals(pbpq.getFcbeginTime())) {
				hql.append("    and issueTime >= TO_DATE('"+pbpq.getFcbeginTime()+" 00:00:00','yyyy-mm-dd hh24:mi:ss')");
			}
			if (pbpq.getFcendTime()!=null && !"".equals(pbpq.getFcendTime())) {
				hql.append("    and issueTime <= TO_DATE('"+pbpq.getFcendTime()+" 23:59:59','yyyy-mm-dd hh24:mi:ss')");
			}
			if (pbpq.getProcurementMethod()!=null && !"".equals(pbpq.getProcurementMethod())) {
				hql.append("    and procurementMethod like '%"+pbpq.getProcurementMethod()+"%'");
			}
			if(pbpq.getPurchaseYears()!=null&&pbpq.getPurchaseYears().trim().length()>0){
				hql.append(" and TO_DATE(purchaseYears,'yyyy') >= TO_DATE('"+pbpq.getPurchaseYears()+"','yyyy')");
			}
			if(pbpq.getEpurchaseYears()!=null&&pbpq.getEpurchaseYears().trim().length()>0){
				hql.append(" and TO_DATE(purchaseYears,'yyyy') <= TO_DATE('"+pbpq.getEpurchaseYears()+"','yyyy')");
			}
			if (pbpq.getProjectName()!=null && !"".equals(pbpq.getProjectName())) {
				hql.append("    and projectName like '%"+pbpq.getProjectName()+"%'");
			}
			if (pbpq.getProjectSituation()!=null && !"".equals(pbpq.getProjectSituation())) {
				hql.append("    and projectSituation like '%"+pbpq.getProjectSituation()+"%'");
			}
			if (pbpq.getProjecttype()!=null && !"".equals(pbpq.getProjecttype())) {
				hql.append("    and projectType like '%"+pbpq.getProjecttype()+"%'");
			}
			if (pbpq.getSecClassification()!=null && !"".equals(pbpq.getSecClassification())) {
				hql.append("    and secClassification like '%"+pbpq.getSecClassification()+"%'");
			}
			if (pbpq.getSecName()!=null && !"".equals(pbpq.getSecName())) {
				hql.append("    and secName like '%"+pbpq.getSecName()+"%'");
			}
			if (pbpq.getSectionName()!=null && !"".equals(pbpq.getSectionName())) {
				hql.append("    and sectionName like '%"+pbpq.getSectionName()+"%'");
			}
			if (pbpq.getAdjustment()!=null && !"".equals(pbpq.getAdjustment())) {
				hql.append("    and adjustment like '%"+pbpq.getAdjustment()+"%'");
			}
		}
		if(units==null){
			hql.append(" and ((status=0 and exists(select 1 from UserInfo u where u.userId = m.createPeople and exists (select 1 from Units n where n.unitsId=u.unitsId and n.unitsLevel = '1'))) or status=1 or status=3) ");
		}
		hql.append(" order by purchaseId desc");
		return super.findPages(hql.toString(), curPage, pageSize);
	}

	@Override
	public PurchaseBiddingPlanTwotz findById(String purchaseId) {
		// TODO Auto-generated method stub
		return (PurchaseBiddingPlanTwotz) super.findById(PurchaseBiddingPlanTwotz.class, purchaseId);
	}

	@Override
	public void update(PurchaseBiddingPlanTwotz purchaseBiddingPlanTwotz) {
		// TODO Auto-generated method stub
		super.update(purchaseBiddingPlanTwotz);
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<PurchasebiddingtwotzStatus> findStatus(String purchaseId) {
		// TODO Auto-generated method stub
		return super.findByProperty(PurchasebiddingtwotzStatus.class, "purchaseId", purchaseId);
	}

	@Override
	public void examine(String ids, Long status) {
		// TODO Auto-generated method stub
		StringBuffer hql = new StringBuffer("update PurchaseBiddingPlanTwotz set status =");
		hql.append(status);
		hql.append(" where purchaseId in (");
		hql.append(ids);
		hql.append(")");
		super.executeUpdate(hql.toString());
	}

	@Override
	public void changeStatus(List<PurchasebiddingtwotzStatus> entities) {
		// TODO Auto-generated method stub
		super.saveAll(entities);
	}

	@Override
	public void delByIds(String[] delIds) {
		// TODO Auto-generated method stub
		super.deleteAllById(PurchaseBiddingPlanTwotz.class, delIds);
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<PurchaseBiddingPlanTwotz> findAllByVo(
			PurchaseBiddingPlanTwotzQueryVo pbpq, Units attribute) {
		// TODO Auto-generated method stub
		StringBuffer hql = new StringBuffer("from PurchaseBiddingPlanTwotz m where 1=1");
		if(pbpq!=null){
			if(pbpq.getFunitsId()!=null){
				hql.append("    and (exists(select 1 from Units u where u.unitsId = m.unitsId and u.funitsId="+pbpq.getFunitsId()+" ) or m.unitsId ="+pbpq.getFunitsId()+" )");
			}
			if(pbpq.getUnitsId()!=null && !"".equals(pbpq.getUnitsId())){
				hql.append(" and  m.unitsId = "+pbpq.getUnitsId()+"");
			}
			if(pbpq.getCreateBeginTime()!=null&&pbpq.getCreateBeginTime().trim().length()>0){
				hql.append(" and createTime >= TO_DATE('"+pbpq.getCreateBeginTime()+" 00:00:00','yyyy-mm-dd hh24:mi:ss')");
			}
			if(pbpq.getCreateEndTime()!=null&&pbpq.getCreateEndTime().trim().length()>0){
				hql.append(" and createTime <= TO_DATE('"+pbpq.getCreateEndTime()+" 23:59:59','yyyy-mm-dd hh24:mi:ss')");
			}
			if(pbpq.getStatus()!=null&&pbpq.getStatus().trim().length()>0&&!pbpq.getStatus().equals("5")){
				hql.append(" and status ="+pbpq.getStatus());
			}
			if (pbpq.getFcbeginTime()!=null && !"".equals(pbpq.getFcbeginTime())) {
				hql.append("    and issueTime >= TO_DATE('"+pbpq.getFcbeginTime()+" 00:00:00','yyyy-mm-dd hh24:mi:ss')");
			}
			if (pbpq.getFcendTime()!=null && !"".equals(pbpq.getFcendTime())) {
				hql.append("    and issueTime <= TO_DATE('"+pbpq.getFcendTime()+" 23:59:59','yyyy-mm-dd hh24:mi:ss')");
			}
			if (pbpq.getProcurementMethod()!=null && !"".equals(pbpq.getProcurementMethod())) {
				hql.append("    and procurementMethod like '%"+pbpq.getProcurementMethod()+"%'");
			}
			if(pbpq.getPurchaseYears()!=null&&pbpq.getPurchaseYears().trim().length()>0){
				hql.append(" and TO_DATE(purchaseYears,'yyyy') >= TO_DATE('"+pbpq.getPurchaseYears()+"','yyyy')");
			}
			if(pbpq.getEpurchaseYears()!=null&&pbpq.getEpurchaseYears().trim().length()>0){
				hql.append(" and TO_DATE(purchaseYears,'yyyy') <= TO_DATE('"+pbpq.getEpurchaseYears()+"','yyyy')");
			}
			if (pbpq.getProjectName()!=null && !"".equals(pbpq.getProjectName())) {
				hql.append("    and projectName like '%"+pbpq.getProjectName()+"%'");
			}
			if (pbpq.getProjectSituation()!=null && !"".equals(pbpq.getProjectSituation())) {
				hql.append("    and projectSituation like '%"+pbpq.getProjectSituation()+"%'");
			}
			if (pbpq.getProjecttype()!=null && !"".equals(pbpq.getProjecttype())) {
				hql.append("    and projectType like '%"+pbpq.getProjecttype()+"%'");
			}
			if (pbpq.getSecClassification()!=null && !"".equals(pbpq.getSecClassification())) {
				hql.append("    and secClassification like '%"+pbpq.getSecClassification()+"%'");
			}
			if (pbpq.getSecName()!=null && !"".equals(pbpq.getSecName())) {
				hql.append("    and secName like '%"+pbpq.getSecName()+"%'");
			}
			if (pbpq.getSectionName()!=null && !"".equals(pbpq.getSectionName())) {
				hql.append("    and sectionName like '%"+pbpq.getSectionName()+"%'");
			}
			if (pbpq.getAdjustment()!=null && !"".equals(pbpq.getAdjustment())) {
				hql.append("    and adjustment like '%"+pbpq.getAdjustment()+"%'");
			}
		}
		if(attribute==null){
			hql.append(" and ((status=0 and exists(select 1 from UserInfo u where u.userId = m.createPeople and exists (select 1 from Units n where n.unitsId=u.unitsId and n.unitsLevel = '1'))) or status=1 or status=3) ");
		}
		hql.append("order by createTime desc");
		return super.find(hql.toString());
	}

	@Override
	public PurchaseBiddingPlanTwotzVo findAllMoney(
			PurchaseBiddingPlanTwotzQueryVo pbpq, Units units) {
		StringBuffer hql = new StringBuffer("select sum(secEvaluation),sum(sectionEvaluation) from PurchaseBiddingPlanTwotz m where 1=1");
		if(pbpq!=null){
			if(pbpq.getFunitsId()!=null){
				hql.append("    and (exists(select 1 from Units u where u.unitsId = m.unitsId and u.funitsId="+pbpq.getFunitsId()+" ) or m.unitsId ="+pbpq.getFunitsId()+" )");
			}
			if(pbpq.getUnitsId()!=null && !"".equals(pbpq.getUnitsId())){
				hql.append(" and  m.unitsId = "+pbpq.getUnitsId()+"");
			}
			if(pbpq.getCreateBeginTime()!=null&&pbpq.getCreateBeginTime().trim().length()>0){
				hql.append(" and createTime >= TO_DATE('"+pbpq.getCreateBeginTime()+" 00:00:00','yyyy-mm-dd hh24:mi:ss')");
			}
			if(pbpq.getCreateEndTime()!=null&&pbpq.getCreateEndTime().trim().length()>0){
				hql.append(" and createTime <= TO_DATE('"+pbpq.getCreateEndTime()+" 23:59:59','yyyy-mm-dd hh24:mi:ss')");
			}
			if(pbpq.getStatus()!=null&&pbpq.getStatus().trim().length()>0&&!pbpq.getStatus().equals("5")){
				hql.append(" and status ="+pbpq.getStatus());
			}
			if (pbpq.getFcbeginTime()!=null && !"".equals(pbpq.getFcbeginTime())) {
				hql.append("    and issueTime >= TO_DATE('"+pbpq.getFcbeginTime()+" 00:00:00','yyyy-mm-dd hh24:mi:ss')");
			}
			if (pbpq.getFcendTime()!=null && !"".equals(pbpq.getFcendTime())) {
				hql.append("    and issueTime <= TO_DATE('"+pbpq.getFcendTime()+" 23:59:59','yyyy-mm-dd hh24:mi:ss')");
			}
			if (pbpq.getProcurementMethod()!=null && !"".equals(pbpq.getProcurementMethod())) {
				hql.append("    and procurementMethod like '%"+pbpq.getProcurementMethod()+"%'");
			}
			if(pbpq.getPurchaseYears()!=null&&pbpq.getPurchaseYears().trim().length()>0){
				hql.append(" and TO_DATE(purchaseYears,'yyyy') >= TO_DATE('"+pbpq.getPurchaseYears()+"','yyyy')");
			}
			if(pbpq.getEpurchaseYears()!=null&&pbpq.getEpurchaseYears().trim().length()>0){
				hql.append(" and TO_DATE(purchaseYears,'yyyy') <= TO_DATE('"+pbpq.getEpurchaseYears()+"','yyyy')");
			}
			if (pbpq.getProjectName()!=null && !"".equals(pbpq.getProjectName())) {
				hql.append("    and projectName like '%"+pbpq.getProjectName()+"%'");
			}
			if (pbpq.getProjectSituation()!=null && !"".equals(pbpq.getProjectSituation())) {
				hql.append("    and projectSituation like '%"+pbpq.getProjectSituation()+"%'");
			}
			if (pbpq.getProjecttype()!=null && !"".equals(pbpq.getProjecttype())) {
				hql.append("    and projectType like '%"+pbpq.getProjecttype()+"%'");
			}
			if (pbpq.getSecClassification()!=null && !"".equals(pbpq.getSecClassification())) {
				hql.append("    and secClassification like '%"+pbpq.getSecClassification()+"%'");
			}
			if (pbpq.getSecName()!=null && !"".equals(pbpq.getSecName())) {
				hql.append("    and secName like '%"+pbpq.getSecName()+"%'");
			}
			if (pbpq.getSectionName()!=null && !"".equals(pbpq.getSectionName())) {
				hql.append("    and sectionName like '%"+pbpq.getSectionName()+"%'");
			}
			if (pbpq.getAdjustment()!=null && !"".equals(pbpq.getAdjustment())) {
				hql.append("    and adjustment like '%"+pbpq.getAdjustment()+"%'");
			}
		}
		PurchaseBiddingPlanTwotzVo p = new PurchaseBiddingPlanTwotzVo();
		List<Object[]> objs = super.find(hql.toString());
		if(objs.size()>0){
			DecimalFormat df = new DecimalFormat("##,###.##");
			try {
				if(objs.get(0)[0]!=null){
				p.setAllMoney1(df.format(df.parse(objs.get(0)[0].toString())));
				}
				if(objs.get(0)[1]!=null){
				p.setAllMoney2(df.format(df.parse(objs.get(0)[1].toString())));
				}
			} catch (ParseException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		
		}
		
		return p;
	}

	
}
